<!Doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<meta name="csrf-token" content="{{ csrf_token() }}">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">	
	<link rel="shortcut icon" type="image/x-icon" href="{{URL::asset('handan/images/logo-icon.png')}}" />
	<title>排名详情</title>
	<link rel="stylesheet" href="{{URL::asset('mobile/css/public.css') }}"/>
	<link rel="stylesheet" href="{{URL::asset('mobile/css/rankdetail.css') }}"/>
	<script src="{{URL::asset('public_js/jquery-3.2.1.min.js')}}"></script>
	<script src="{{URL::asset('mobile/js/public.js') }}"></script>
	<script>
			function langxue(obj) {
				$(obj).siblings('.detail').toggle();
			}
		</script>
</head>
<body>
	<!--名字简介-->
	<!--<div class="namedetail">
		<div class="name">
			<p><img src="{{URL::asset('mobile/image/fxs_icond.png')}}" alt="" /></p>
			<p>西部小哥</p>
		</div>
		<div class="bonus">
			<p>目前名次</p>
			<p>3</p>
			<p class="line"></p>
			<p>总盈利</p>
			<p>888</p>
		</div>
	</div>-->
	<!--详情-->
	<!-- <section>
		<div class="list" onclick="langxue(this);">
			<div class="type">
				<p>美元黄金</p>
				<p>XAUUSD</p>
			</div>
			<div class="direction">
				<p>卖出</p>
				<p>方向</p>
			</div>
			<div class="profit">
				<p style="color: #3EB581;">-50</p>
				<p>盈利</p>
			</div>
		</div>
		<div class="detail">
			<div class="detail_top">
				<div class="detail_top_left">
					<div class="openprice">
						<p>开仓价</p>
						<p>1283.12</p>
					</div>
					<div class="onlyprofit">
						<p>止&nbsp;&nbsp;&nbsp;盈</p>
						<p>1283.12</p>
					</div>
					<div class="stoploss">
						<p>止&nbsp;&nbsp;&nbsp;损</p>
						<p>1283.12</p>
					</div>
				</div>
				<div class="detail_top_right">
					<div class="closeprice">
						<p>平&nbsp;&nbsp;仓&nbsp;&nbsp;价</p>
						<p>1283.12</p>
					</div>
					<div class="opentime">
						<p>开仓时间</p>
						<p>2017.05.05 08.21.21</p>
					</div>
					<div class="closetime">
						<p>平仓时间</p>
						<p>2017.05.05 08.21.21</p>
					</div>
				</div>
			</div>
			<div class="detail_bottom">
				<p>订单号:</p>
				<p>AA1546655</p>
			</div>
		</div>
	</section> -->
	
<script>
	var doinfourl = '{{url("/showinfo")}}';
	$("document").ready(function(){
		var ranking = "{{$_GET['ranking']}}";
		var userid  = "{{$_GET['userid']}}";
		$.ajax({
             url: doinfourl,
             type: "post",
             data:  {userid:userid},
             headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
             dataType:'json',
             async:false,
             success: function (data) {
                 if(data.status == 1){
                    layer.msg(data.msg,{time:1000});
                 }else{
                    var str='';
                    	str+='<div class="namedetail"><div class="name">';
                    	str+='<p><img src="'+'{{$memberinfo[0]->photo}}'+'" alt="" /></p>';
                    	str+='<p>'+'{{$memberinfo[0]->username}}'+'</p></div>';
                    	str+='<div class="bonus">';
                    	str+='<p>目前名次</p><p>'+ranking+'</p>'; //目前名次
                    	str+='<p class="line"></p>';
                    	str+='<p>总盈利</p><p>'+Number('{{$memberinfo[0]->order_final_point}}').toFixed(2)+'</p></div></div>';
                    	for(var i=0;i<data.trendpointobj.length;i++) {
							str+='<section><div class="list" onclick="langxue(this);">';
							str+='<div class="type"><p>'+data.trendpointobj[i].chinaname+'</p><p>'+data.trendpointobj[i].typename+'</p></div>'; //品种英文
							str+='<div class="direction">';
							if(data.trendpointobj[i].buy_status == 1){
	                            str += '<p>卖出</p>';
	                        }else{
	                            str += '<p>买入</p>';
	                        }
							str+='<p>方向</p></div>';
							str+='<div class="profit">';
							if(data.trendpointobj[i].final_point >0 ){
	                            str += '<div style="color:#F0364C;">'+data.trendpointobj[i].final_point+'</div>';
	                        }else{
	                            str += '<div style="color:#3EB581;">'+data.trendpointobj[i].final_point+'</div>';
	                        }
							str+='<p>盈利</p></div></div>';
							str+='<div class="detail"><div class="detail_top"><div class="detail_top_left">';
							str+='<div class="openprice"><p>开仓价</p><p>'+data.trendpointobj[i].begin_point+'</p></div>'; //开仓价格
							str+='<div class="onlyprofit"><p>止&nbsp;&nbsp;&nbsp;盈</p><p>'+data.trendpointobj[i].target_profit_point+'</p></div>';
							str+='<div class="stoploss"><p>止&nbsp;&nbsp;&nbsp;损</p><p>'+data.trendpointobj[i].target_loss_point+'</p></div></div>';
							str+='<div class="detail_top_right">';
							str+='<div class="closeprice"><p>平&nbsp;&nbsp;仓&nbsp;&nbsp;价</p><p>'+data.trendpointobj[i].end_point+'</p></div>'; //平仓价格
							str+='<div class="opentime"><p>开仓时间</p><p>'+UnixToDate(data.trendpointobj[i].begin_time,false,'',1)+' '+UnixToDate(data.trendpointobj[i].begin_time,true,'',0)+'</p></div>';
							str+='<div class="closetime"><p>平仓时间</p><p>'+UnixToDate(data.trendpointobj[i].end_time,false,'',1)+' '+UnixToDate(data.trendpointobj[i].end_time,true,'',0)+'</p></div></div></div>';
							str+='<div class="detail_bottom"><p>订单号:</p><p>'+data.trendpointobj[i].tradeid+'</p></div></div></section>';
						}
						$('body').html(str);
					}
             	}
         	});
		});
    //时间转换方法
    function UnixToDate(unixTime, isFull, timeZone,type) {
        if (typeof (timeZone) == 'number')
        {
            unixTime = parseInt(unixTime) + parseInt(timeZone) * 60 * 60;
        }
        var time = new Date(unixTime * 1000);
        var ymdhis = "";
        if(type){
            ymdhis += time.getFullYear() + ".";
            ymdhis += (time.getMonth()+1)>9?(time.getMonth()+1)+'.':'0'+(time.getMonth()+1) + ".";
            ymdhis += time.getDate()>9?time.getDate():'0'+time.getDate();
        }
        if (isFull === true)
        {

            ymdhis += " " + time.getHours()>9?time.getHours()+ ":":'0'+time.getHours() + ":";
            ymdhis += time.getMinutes()>9?time.getMinutes()+ ":":'0'+time.getMinutes() + ":";
            ymdhis += time.getSeconds()>9?time.getSeconds():'0'+time.getSeconds();
        }
        return ymdhis;
    }     
</script>
</body>
</html>
